module.exports = (sequelize, Sequelize) => {
    return sequelize.define("chatRoom", {
        id: {
            type: Sequelize.UUID,
            notNull: true,
            primaryKey: true,
            defaultValue: Sequelize.UUIDV4
        },
        roomName: {
            type: Sequelize.STRING,
            comment: '聊天室名称',
        },
        roomId: {
            type: Sequelize.STRING,
            comment: '聊天室ID',
            unique: true
        },
        creator: {
            type: Sequelize.STRING,
            comment: '创建者',
        },
        members: {
            type: Sequelize.TEXT,
            comment: '成员列表(JSON字符串)',
        },
    }, {
        tableName: 'mg_chat_room'
    });
};